SQL Server 2014 with PowerShell v5 Cookbook by Santos Donabel
Author:Santos, Donabel [Santos, Donabel]
Language: eng
Format: mobi
Publisher: Packt Publishing
Published: 2015-12-03T16:00:00+00:00
#need to establish unique ID for base table
$fullTextIndex.UniqueIndexName = "PK_Documents_DocumentID"
$fullTextIndex.Create()
The equivalent T-SQL statement to create this index is as follows:
CREATE FULLTEXT INDEX ON [dbo].[Documents]
KEY INDEX [PK_Documents_DocumentID]ON ([FTC])
WITH (STOPLIST = [SYSTEM])
With a full-text index, you can add additional text columns that can be searched. In our recipe, we add the Name columns to our index. This will allow the content of Name to be full-text searched:
#specify column for index
$documentNameCol = New-Object -TypeName Microsoft.SqlServer.Management.Smo.FullTextIndexColumn -ArgumentList $fullTextIndex, "Name"
$documentNameCol.Language = "English"
$documentNameCol.Create()
If you were to do this in T-SQL, this would be your script:
ALTER FULLTEXT INDEX
ON [dbo].[Documents]
ADD
(
[Name] LANGUAGE [English]
)
Because our table also has another field that specifies the document type, we can add this to our full-text index. We can specify this using the TypeColumnName property:
$documentContentCol = New-Object -TypeName Microsoft.SqlServer.Management.Smo.FullTextIndexColumn -ArgumentList $fullTextIndex, "Content"
$documentContentCol.Language = "English"
$documentContentCol.TypeColumnName = "Extension"
$documentContentCol.Create()
The addition of the type column to T-SQL is as follows:
ALTER FULLTEXT INDEX
ON [dbo].[Documents]
ADD
(
[Content] TYPE COLUMN [Extension] LANGUAGE [English]
)
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
What's Done in Darkness by Kayla Perrin(26806)
The Ultimate Python Exercise Book: 700 Practical Exercises for Beginners with Quiz Questions by Copy(20673)
De Souza H. Master the Age of Artificial Intelligences. The Basic Guide...2024 by Unknown(20448)
D:\Jan\FTP\HOL\Work\Alien Breed - Tower Assault CD32 Alien Breed II - The Horror Continues Manual 1.jpg by PDFCreator(20445)
The Fifty Shades Trilogy & Grey by E L James(19311)
Shot Through the Heart: DI Grace Fisher 2 by Isabelle Grey(19263)
Shot Through the Heart by Mercy Celeste(19129)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 10 by Isuna Hasekura and Jyuu Ayakura(17294)
Python GUI Applications using PyQt5 : The hands-on guide to build apps with Python by Verdugo Leire(17229)
Peren F. Statistics for Business and Economics...Essential Formulas 3ed 2025 by Unknown(17076)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 03 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16999)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 01 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16616)
The Subtle Art of Not Giving a F*ck by Mark Manson(14619)
The 3rd Cycle of the Betrayed Series Collection: Extremely Controversial Historical Thrillers (Betrayed Series Boxed set) by McCray Carolyn(14311)
Stepbrother Stories 2 - 21 Taboo Story Collection (Brother Sister Stepbrother Stepsister Taboo Pseudo Incest Family Virgin Creampie Pregnant Forced Pregnancy Breeding) by Roxi Harding(13976)
Scorched Earth by Nick Kyme(12964)
Drei Generationen auf dem Jakobsweg by Stein Pia(11148)
Suna by Ziefle Pia(11077)
Scythe by Neal Shusterman(10557)